A flash memory is a non-volatile memory and is classified into a NOR type and a NAND type according to different internal connection structures. The NAND type has a relatively simple structure and is therefore widely applied to a flash memory SSD. A flash memory unit adopts unidirectional programming, reading and writing are performed in units of pages, erasing is performed in units of blocks, and the flash memory unit needs to be erased before a page is rewritten. Therefore, a remote data update policy is used in the flash memory. A flash memory page includes an OOB (out-of-band) area, which may be used as page metadata.
Because of the out-of-place update of the flash memory, new versions and old versions of data can coexist in the storage, and this is suitable for transaction processing. An objective of the transaction processing is to ensure atomicity of a transaction operation and ensure consistency between servers even when a failure occurs during execution of a transaction. In a distributed transaction, the process of executing the transaction is controlled by using an atomic commit protocol to common two-phase commit protocol), and the temporary data version and transaction execution state are recorded by using the logging technology. In two-phase commit of the transaction, state log writing is performed five times. In addition, a log includes a temporary version whose size is the same as that of transaction data. Too many times of log writing bring about double overheads of time and space. Therefore, some studies attempt to modify the mapping (a shadow paging technology) to avoid operation overheads of writing back from logs. However, because the conventional storage has limited random read and write performance and a locality corruption may also affect performance, the conventional storage does not use the method. The flash memory storage can overcome the foregoing disadvantage. In some centralized transaction designs based on a flash memory, temporary data is organized as a shadow version, and the shadow version is updated to an FTL mapping table only when a transaction is committed, which avoids a process of writing data into a log first and then writing back the data. However, in a distributed transaction, to improve transaction processing performance by reducing the number of logs (temporary version records and state records), it needs to be ensured that transaction logic is performed normally and that sufficient redundant data is available during failure recovery. In addition to log operations, too many communications also bring about overheads. In addition, the two-phase commit protocol is a blocking protocol, which needs large overheads when the communications are blocked.